package com.qf.nz.provider.service;

import com.qf.nz.entity.Student;
import com.qf.nz.provider.mapper.StudentMapper;
import com.qf.nz.vo.VO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 2020/2/11
 * 郭程鹏
 * NZ-20-Dubbo
 * 面向代码面向君,不负时光不负卿
 */
@Component
@Service(version = "1.0.0")
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public VO selectStudentList() {
        List<Student> allStudents = studentMapper.findAllStudents();
        return VO.OK(allStudents);
    }

    @Override
    public VO selectStudent(Integer sId) {
        Student student = studentMapper.findStudent(sId);
        return VO.OK(student);
    }
}
